class Solution {
public:
    vector<int> path;
    void dfs(int n, int k, int start, vector<vector<int>> &result) {
        if (path.size() == k) {
            result.push_back(path);
            return ;
        }
        for (int i = start; i <= n; i++) {
            path.push_back(i);
            dfs(n, k, i + 1, result);
            path.pop_back();
        }
        return ;
    }
    vector<vector<int>> combine(int n, int k) {
        vector<vector<int> > result;
        dfs(n, k, 1, result);
        return result;
    }
};
